#ifndef GW_PROTOCOL_H
#define GW_PROTOCOL_H
#include "stm32f0xx_hal.h"
#include <vector>
#include "GWType.h"

class GW_Protocol
{
     
private:


public:
   static const int MAXBUF=100;
   virtual void GetByte(u8 dat);
   virtual void TimeOut();
   virtual void Init();
   virtual bool Matching();
   virtual void SendMsg();

   void clearRecvBuf();
   void clearSendBuf();

   u8 sendbuf[MAXBUF];
   u8 recvbuf[MAXBUF];

protected:

   virtual void beforeTimeout();
   virtual void afterTimeout();
   virtual void beforeGetByte();
   virtual void afterGetByte();

   GW_COM_State_TypeDef state;



};

#endif
